namespace Crux.Core.Websockets;
/// <summary>
/// WebSocketLifetimeManagerOfT
/// </summary>
public abstract class WebSocketLifetimeManager<THandler>
    : ILifetimeManager where THandler : WebSocketHandler
{
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task OnConnectedAsync(WebSocketConnectionContext webSocketConnectionContext);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task OnDisconnectedAsync(WebSocketConnectionContext webSocketConnectionContext);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendAllAsync(
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendAllExceptAsync(
        string methodName,
        object[] args,
        IReadOnlyList<string> exceptList,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendConnectionAsync(
        string connectionId,
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendConnectionsAsync(
        IReadOnlyList<string> connectionIds,
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendGroupAsync(
        string groupName,
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendGroupsAsync(
        IReadOnlyList<string> groupNames,
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendGroupExceptAsync(
        string groupName,
        string methodName,
        object[] args,
        IReadOnlyList<string> connectionIds,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendUserAsync(
        string userId,
        string methodName,
        object[] args,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task SendUsersAsync(
        IReadOnlyList<string> userId,
        string methodName,
        object[] args,
        CancellationToken cancellation = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task AddToGroupAsync(
        string connectionId,
        string groupName,
        CancellationToken cancellationToken = default);
    /// <inheritdoc cref="ILifetimeManager"/>
    public abstract Task RemoveToGroupAsync(
        string connectionId,
        string groupName,
        CancellationToken cancellationToken = default);
}
